/// Author: QP
/// Version: 1.0
/// Date:2021/07
/// 文档活动类
Class HCC.SQL.Document.Header.Activity Extends (%SerialObject, %XML.Adaptor, HCC.SQL.Base) [ DependsOn = HCC.SQL.Base ]
{

/// 文档模板编号OID
Property templateId As %String [ Private, ReadOnly, SqlComputeCode = {set {templateId}=$lg($G(^WS.Doc.Code({code})),2)}, SqlComputed, SqlComputeOnChange = code ];

/// 文档流水号
Property docid As %String [ InitialExpression = {$ZCVT($SYSTEM.Util.CreateGUID(),"L")}, Private, Required ];

/// 文档类型代码。title\templateId都由code自动赋值
Property code As %String [ Required ];

/// 文档标题
Property title As %String [ Private, ReadOnly, SqlComputeCode = {set {title}=$lg($G(^WS.Doc.Code({code})),1)}, SqlComputed, SqlComputeOnChange = code ];

/// 文档机器生成时间
Property effectiveTime As %String [ Required ];

/// 文档密级代码
Property confidentialityCode As %String [ InitialExpression = "N", Required ];

/// 文档语言类型编码
Property languageCode As %String [ InitialExpression = "zh-CN", Required ];

/// 文档集合编号
Property setId As %String;

/// 文档版本号码
Property versionNumber As %String;


Trigger BeforeInsert [ Event = INSERT ]
{
    Set {title}=$lg($G(^WS.Doc.Code({code})),1),{templateId}=$lg($G(^WS.Doc.Code({code})),2)
}

}
